# @Time    :2025/4/8 8:31
"""
1.使用multiprocessing模块创建两个进程，一个进程打印从1到5的数字，另一个进程打印从6到10的数
字。

"""
import multiprocessing
import time


def func1():
    for i in range(1, 6):
        print(f"Process 1:{i}")
        time.sleep(0.5)


def func2():
    for j in range(6,11):
        print(f"Process 2:{j}")
        time.sleep(0.5)


if __name__ == "__main__":
    p1 = multiprocessing.Process(target=func1)
    p2 = multiprocessing.Process(target=func2)
    p1.start()
    p2.start()
    p1.join()
    p2.join()
    print("All processes finished")
